﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Medication : System.Web.UI.Page
{
    ConnectData con = new ConnectData();
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlDataReader result = con.dataReader("select * from tblPharmaceutical");
        DataTable tb = new DataTable();
        tb.Columns.Add("Name", typeof(string));
        tb.Columns.Add("Description", typeof(string));
        tb.Columns.Add("Dosage", typeof(string));
        tb.Columns.Add("DosageUnit", typeof(string));
        tb.Columns.Add("MethodOfAdmin", typeof(string));
        tb.Columns.Add("Quantity", typeof(string));
        tb.Columns.Add("ReorderLevel", typeof(Int32));
        tb.Columns.Add("CostPerUnit", typeof(Int32));
        tb.Columns.Add("SupplierNumber", typeof(Int32));
        while (result.Read())
        {
            DataRow row = tb.NewRow();
            row[0] = result["Name"];
            row[1] = result["Description"];
            row[2] = result["Dosage"];
            row[3] = result["DosageUnit"];
            row[4] = result["MethodOfAdmin"];
            row[5] = result["Quantity"];
            row[6] = result["ReorderLevel"];
            row[7] = result["CostPerUnit"];
            row[8] = result["SupplierNumber"];
            tb.Rows.Add(row);
        }
         con.closeConnect();
         GridView1.DataSource = tb;
         GridView1.DataBind(); 
      
    }
  

   
    
}